package com.ruoyi.cinema.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cinema.mapper.FilmMapper;
import com.ruoyi.cinema.domain.Film;
import com.ruoyi.cinema.service.IFilmService;

/**
 * 影片Service业务层处理
 *
 * @author HHAOYU
 * @date 2020-12-07
 */
@Service
public class FilmServiceImpl extends ServiceImpl<FilmMapper, Film> implements IFilmService  {
    @Autowired
    private FilmMapper filmMapper;

    /**
     * 查询影片
     *
     * @param id 影片ID
     * @return 影片
     */
    @Override
    public Film selectFilmById(Long id)
    {
        return filmMapper.selectFilmById(id);
    }


    @Override
    public Long selectIdByFilmCode(String filmCode) {
        return filmMapper.selectIdByFilmCode(filmCode);
    }

    /**
     * 查询影片列表
     *
     * @param film 影片
     * @return 影片
     */
    @Override
    public List<Film> selectFilmList(Film film)
    {
        return filmMapper.selectFilmList(film);
    }

    /**
     * 新增影片
     *
     * @param film 影片
     * @return 结果
     */
    @Override
    public int insertFilm(Film film)
    {
        return filmMapper.insertFilm(film);
    }

    /**
     * 修改影片
     *
     * @param film 影片
     * @return 结果
     */
    @Override
    public int updateFilm(Film film)
    {
        return filmMapper.updateFilm(film);
    }

    /**
     * 批量删除影片
     *
     * @param ids 需要删除的影片ID
     * @return 结果
     */
    @Override
    public int deleteFilmByIds(Long[] ids)
    {
        return filmMapper.deleteFilmByIds(ids);
    }

    /**
     * 删除影片信息
     *
     * @param id 影片ID
     * @return 结果
     */
    @Override
    public int deleteFilmById(Long id)
    {
        return filmMapper.deleteFilmById(id);
    }
}
